Image processing method, image processing device, electronic apparatus and storage medium

ABSTRACT

An image processing method, an image processing device, an electronic apparatus, and a non-transitory computer-readable storage medium are provided. The image processing method includes: obtaining an original image; performing slicing processing on the original image to obtain multiple slice images of the original image; respectively processing the slice images through a first binarization model to obtain multiple slice binary images respectively corresponding to the slice images; performing stitching processing on the slice binary images to obtain a first binary image; processing the first binary image to obtain a pixel circumscribed contour image; processing the original image through a second binarization model to obtain a second binary image; synthesizing the second binary image and the first binary image according to positions of multiple circumscribed contour pixels in the pixel circumscribed contour image to obtain a synthetic image.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of China application serialno. 202010851952.X, filed on Aug. 21, 2020. The entirety of theabove-mentioned patent application is hereby incorporated by referenceherein and made a part of this specification.

BACKGROUND Technical Field

The disclosure relates to an image processing method, an imageprocessing device, an electronic apparatus, and a non-transitorycomputer-readable storage medium.

Description of Related Art

In digital image processing, image binarization processing is to set thegrayscale value of a pixel point on an image to 0 or 255. Performingimage binarization processing on the image may greatly reduce the amountof data in the image, thereby highlighting the contour of the target ofinterest. In addition, image binarization processing also facilitatesthe processing and analysis of the image, for example, the extraction ofinformation in the image.

SUMMARY

At least one embodiment of the disclosure provides an image processingmethod, which includes the following steps. An original image isobtained. The original image includes at least one object. Slicingprocessing is performed on the original image to obtain multiple sliceimages of the original image. The slice images are respectivelyprocessed through a first binarization model to obtain multiple slicebinary images respectively corresponding to the slice images. Stitchingprocessing is performed on the slice binary images to obtain a firstbinary image. The first binary image is processed to obtain a pixelcircumscribed contour image. The pixel circumscribed contour imageincludes multiple circumscribed contour pixels. Pixels in a regionsurrounded by the circumscribed contour pixels are pixels correspondingto at least a part of the at least one object. The original image isprocessed through a second binarization model to obtain a second binaryimage. The second binary image and the first binary image aresynthesized according to positions of the circumscribed contour pixelsin the pixel circumscribed contour image to obtain a synthetic image.The synthetic image is a binary image.

For example, in the image processing method according to at least oneembodiment of the disclosure, performing slicing processing on theoriginal image to obtain the slice images of the original image includesthe following steps. A first slice size and an extension slice size aredetermined. A second slice size is determined according to the firstslice size and the extension slice size. A number of slices isdetermined according to a size of the original image and the secondslice size. Slicing processing is performed on the original imageaccording to the extension slice size, the second slice size, and thenumber of slices to obtain the slice images of the original image. Anumber of slice images is equal to the number of slices. A size of eachslice image in the slice images is the first slice size.

For example, in the image processing method according to at least oneembodiment of the disclosure, performing slicing processing on theoriginal image according to the extension slice size, the second slicesize, and the number of slices to obtain the slice images of theoriginal image includes the following steps. An original image to besliced is determined based on the original image according to the secondslice size and the number of slices. Slicing processing is performed onthe original image to be sliced based on the second slice size and theextension slice size to obtain the slice images.

For example, in the image processing method according to at least oneembodiment of the disclosure, performing slicing processing on theoriginal image to be sliced based on the second slice size and theextension slice size to obtain the slice images includes the followingsteps. The original image to be sliced is divided into multiplesubregions according to the second slice size. A number of thesubregions is equal to the number of slices. Slicing processing isperformed on the original image to be sliced according to the extensionslice size and the subregions to obtain the slice images. The sliceimages correspond to the subregions one-to-one.

Each slice image in the slice images includes a corresponding subregionin the subregions.

For example, in the image processing method according to at least oneembodiment of the disclosure, the original image includes four fixededges. Each subregion in the subregions includes four region edges.Performing slicing processing on the original image to be slicedaccording to the extension slice size and the subregions to obtain theslice images includes the following steps. In response to all fourregion edges corresponding to an i-th subregion in the subregions notoverlapping with the four fixed edges, the four region edgescorresponding to the i-th subregion are respectively extended by theextension slice size in a direction away from the i-th subregion withthe i-th subregion as a center to obtain a slice position correspondingto a slice image corresponding to the i-th subregion. The original imageto be sliced is sliced according to the slice position to obtain theslice image corresponding to the i-th subregion. Alternatively, inresponse to one region edge in four region edges corresponding to ani-th subregion in the subregions overlapping with one fixed edge in thefour fixed edges, a region edge opposite to the one region edge in thefour region edges is extended by twice the extension slice size in adirection away from the i-th subregion, and region edges adjacent to theone region edge in the four region edges are respectively extended bythe extension slice size in the direction away from the i-th subregionto obtain a slice position corresponding to a slice image correspondingto the i-th subregion. The original image to be sliced is slicedaccording to the slice position to obtain the slice image correspondingto the i-th subregion. Alternatively, in response to two region edges infour region edges corresponding to an i-th subregion in the subregionsoverlapping with two fixed edges in the four fixed edges, other regionedges other than the two region edges in the four region edges areextended by twice the extension slice size in a direction away from thei-th subregion to obtain a slice position corresponding to a slice imagecorresponding to the i-th subregion. The original image to be sliced issliced according to the slice position to obtain the slice imagecorresponding to the i-th subregion, where i is a positive integer andis less than or equal to the number of the subregions.

For example, in the image processing method according to at least oneembodiment of the disclosure, a size of each slice binary image in theslice binary images is the first slice size. Performing stitchingprocessing on the slice binary images to obtain the first binary imageincludes the following steps. A positional relationship of the slicebinary images is determined according to a positional relationship ofthe subregions in the original image to be sliced. Stitching processingis performed on the slice binary images based on the positionalrelationship of the slice binary images to obtain a binary predictionimage. In response to a size of the binary prediction image being notequal to the size of the original image, size restoration processing isperformed on the binary prediction image to obtain the first binaryimage. In response to the size of the binary prediction image beingequal to the size of the original image, the binary prediction image isused as the first binary image. The size of the first binary image isthe same as the size of the original image.

For example, in the image processing method according to at least oneembodiment of the disclosure, all pixels in the first binary image arearranged in n rows and m columns. Performing stitching processing on theslice binary images based on the positional relationship of the slicebinary images to obtain the binary prediction image includes thefollowing steps. Performing stitching processing on the slice binaryimages based on the positional relationship of the slice binary imagesto obtain an intermediate binary prediction image. All pixels in theintermediate binary prediction image are arranged in n rows and mcolumns. In response to a t1-th row and a t2-th column in theintermediate binary prediction image including only one pixel, agrayscale value of the one pixel located in the t1-th row and the t2-thcolumn is used as a grayscale value of a pixel in a t1-th row and at2-th column in the binary prediction image. In response to the t1-throw and the t2-th column in the intermediate binary prediction imageincluding multiple pixels, OR operation is performed on grayscale valuesof the pixels located in the t1-th row and the t2-th column to obtaingrayscale values of pixels in the t1-th row and the t2-th column in thebinary prediction image, where n, m, t1, and t2 are all positiveintegers, t1 is less than or equal to n, and t2 is less than or equal tom.

For example, in the image processing method according to at least oneembodiment of the disclosure, performing slicing processing on theoriginal image to obtain the slice images of the original image includesthe following steps. The second slice size is determined. The number ofslices is determined according to the size of the original image and thesecond slice size. Slicing processing is performed on the original imageaccording to the second slice size and the number of slices to obtainthe slice images of the original image. The number of slice images isequal to the number of slices. The size of each slice image in the sliceimages is the second slice size.

For example, in the image processing method according to at least oneembodiment of the disclosure, performing slicing processing on theoriginal image according to the second slice size and the number ofslices to obtain the slice images of the original image includes thefollowing steps. The original image to be sliced is determined based onthe original image according to the second slice size and the number ofslices. Slicing processing is performed on the original image to besliced based on the second slice size to obtain the slice images.

For example, in the image processing method according to at least oneembodiment of the disclosure, the size of each slice binary image in theslice binary images is the second slice size. Performing stitchingprocessing on the slice binary images to obtain the first binary imageincludes the following steps. The positional relationship of the slicebinary images is determined according to the positional relationship ofthe slice images in the original image to be sliced.

Stitching processing is performed on the slice binary images based onthe positional relationship of the slice binary images to obtain thebinary prediction image. In response to the size of the binaryprediction image being not equal to the size of the original image, sizerestoration processing is performed on the binary prediction image toobtain the first binary image. In response to the size of the binaryprediction image being equal to the size of the original image, thebinary prediction image is used as the first binary image. The size ofthe first binary image is the same as the size of the original image.

For example, in the image processing method according to at least oneembodiment of the disclosure, determining the original image to besliced based on the original image according to the second slice sizeand the number of slices includes the following steps. A size to besliced is determined according to the second slice size and the numberof slices. In response to the size of the original image being the sameas the size to be sliced, the original image is used as the originalimage to be sliced. In response to the size of the original image beingdifferent from the size to be sliced, the size of the original image isadjusted to obtain the original image to be sliced. The size of theoriginal image to be sliced is the same as the size to be sliced.

For example, in the image processing method according to at least oneembodiment of the disclosure, a number of slices L is obtained throughthe following equation:

L=round(m/p)×round(n/q)

where the size of the original image is m×n, the second slice size is×q, and round(*) indicates a rounding function.

For example, in the image processing method according to at least oneembodiment of the disclosure, processing the first binary image toobtain the pixel circumscribed contour image includes the followingsteps. Blurring processing is performed on the first binary image toobtain a blur image. XOR processing is performed on the blur image andthe first binary image to obtain the pixel circumscribed contour image.

For example, in the image processing method according to at least oneembodiment of the disclosure, synthesizing the second binary image andthe first binary image according to the positions of the circumscribedcontour pixels in the pixel circumscribed contour image to obtain thesynthetic image includes the following steps. The positions of thecircumscribed contour pixels in the pixel circumscribed contour imageare obtained. Multiple target second binary pixels at positions in thesecond binary image corresponding to the positions of the circumscribedcontour pixels are extracted. The target second binary pixels in thesecond binary image are respectively synthesized to same positions inthe first binary image according to a pixel correspondence between thesecond binary image and the first binary image to obtain the syntheticimage.

For example, in the image processing method according to at least oneembodiment of the disclosure, processing the original image through thesecond binarization model to obtain the second binary image includes thefollowing steps. Grayscale processing is performed on the original imageto obtain a grayscale image. The grayscale image is processed accordingto a first threshold to obtain an intermediate binary image. Guidingfiltering processing is performed on the grayscale image by using theintermediate binary image as a guiding image to obtain a filter image. Ahigh-value pixel in the filter image is determined according to thesecond threshold.

A grayscale value of the high-value pixel is greater than the secondthreshold. Expanding processing is performed on the grayscale value ofthe high-value pixel according to a preset expansion coefficient toobtain an expansion image. Sharpening processing is performed on theexpansion image to obtain a clear image. A contrast of the clear imageis adjusted to obtain the second binary image.

For example, in the image processing method according to at least oneembodiment of the disclosure further includes the following step. Blackedge removal processing is performed on the synthetic image.

For example, in the image processing method according to at least oneembodiment of the disclosure, performing black edge removal processingon the synthetic image includes the following steps. An edge region ofthe synthetic image is determined. The edge region of the syntheticimage is traversed to judge whether there is a black region whose sizeexceeds a preset threshold. In response to the edge region including atleast one black region whose size exceeds the preset threshold, agrayscale value of a pixel corresponding to the at least one blackregion is set to a preset grayscale value.

At least one embodiment of the disclosure provides an image processingdevice, which includes the following. An obtaining module is configuredto obtain an original image. The original image includes at least oneobject. A slicing module is configured to perform slicing processing onthe original image to obtain multiple slice images of the originalimage. A first binarization module is configured to respectively processthe slice images through a first binarization model to obtain multipleslice binary images respectively corresponding to the slice images. Astitching module is configured to perform stitching processing on theslice binary images to obtain a first binary image. A processing moduleis configured to process the first binary image to obtain a pixelcircumscribed contour image. The pixel circumscribed contour imageincludes multiple circumscribed contour pixels. Pixels in a regionsurrounded by the circumscribed contour pixels are pixels correspondingto at least a part of the at least one object.

A second binarization module is configured to process the original imagethrough a second binarization model to obtain a second binary image. Asynthesis module is configured to synthesize the second binary image andthe first binary image according to positions of the circumscribedcontour pixels in the pixel circumscribed contour image to obtain asynthetic image. The synthetic image is a binary image.

At least one embodiment of the disclosure provides an electronicapparatus, which includes the following. A memory is configured tonon-transitorily store a computer-readable instruction. A processor isconfigured to run the computer-readable instruction. When thecomputer-readable instruction is run by the processor, an imageprocessing method according to any embodiment of the disclosure isimplemented.

At least one embodiment of the disclosure provides a non-transitorycomputer-readable storage medium. The non-transitory computer-readablestorage medium stores a computer-readable instruction. When thecomputer-readable instruction is executed by a processor, an imageprocessing method according to any embodiment of the disclosure isimplemented.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to explain the technical solutions according to the embodimentsof the disclosure more clearly, the drawings of the embodiments will bebriefly introduced below. Obviously, the drawings in the followingdescription only relate to some embodiments of the disclosure, ratherthan limit the disclosure.

FIG. 1 is a schematic flowchart of an image processing method accordingto at least one embodiment of the disclosure.

FIG. 2 is a schematic diagram of an original image according to at leastone embodiment of the disclosure.

FIG. 3 is an exemplary flowchart of Step S120 in the image processingmethod shown in FIG. 1.

FIG. 4 is a schematic diagram of an original image to be slicedaccording to an embodiment of the disclosure.

FIGS. 5a to 5c are schematic diagrams of a process of image slicingprocessing according to at least one embodiment of the disclosure.

FIGS. 6a to 6i are schematic diagrams of slice binary images accordingto an embodiment of the disclosure.

FIG. 7a is an exemplary flowchart of Step S140 in the image processingmethod shown in FIG. 1.

FIG. 7b is a schematic diagram of an intermediate binary predictionimage according to at least one embodiment of the disclosure.

FIG. 8 is a schematic diagram of a first binary image according to anembodiment of the disclosure.

FIG. 9 is a schematic diagram of a blur image according to an embodimentof the disclosure.

FIG. 10 is a pixel circumscribed contour image according to anembodiment of the disclosure.

FIG. 11 is a schematic diagram of a second binary image according to anembodiment of the disclosure.

FIG. 12 is a schematic diagram of a synthetic image according to anembodiment of the disclosure.

FIG. 13a is a synthetic image with black edges according to anembodiment of the disclosure.

FIG. 13b is a synthetic image with black edges removed according to anembodiment of the disclosure.

FIG. 14 is a schematic block diagram of an image processing deviceaccording to at least one embodiment of the disclosure.

FIG. 15 is a schematic block diagram of an electronic apparatusaccording to at least one embodiment of the disclosure.

FIG. 16 is a schematic diagram of a non-transitory computer-readablestorage medium according to at least one embodiment of the disclosure.

FIG. 17 is a schematic diagram of a hardware environment according to atleast one embodiment of the disclosure.

DETAILED DESCRIPTION OF DISCLOSED EMBODIMENTS

In order for the objectives, technical solutions, and advantages of theembodiments of the disclosure to be clearer, the technical solutions ofthe embodiments of the disclosure will be described clearly andcompletely in conjunction with the accompanying drawings. Obviously, thedescribed embodiments are part of the embodiments of the disclosure,rather than all of the embodiments. Based on the described embodimentsof the disclosure, all other embodiments obtained by persons skilled inthe art without inventive efforts are within the protection scope of thedisclosure.

Unless otherwise defined, the technical terms or scientific terms usedin the disclosure shall have the conventional meanings understood bypersons skilled in the art to which the disclosure belongs. Similarwords such as “first” and “second” used in the disclosure do notindicate any order, quantity, or importance, but are only used todistinguish different components. Similarly, similar words such as“one”, “a”, or “the” do not indicate a quantity limit, but ratherindicate that there is at least one. Similar words such as “include” or“comprise” mean that an element or an item appearing before the wordcovers an element or an item listed after the word or the item and itsequivalents, but does not exclude other elements or items. Similar wordssuch as “connected to” or “connected with” are not limited to physicalor mechanical connections, but may include electrical connections,whether direct or indirect. Terms such as “up”, “down”, “left”, and“right” are only used to indicate a relative positional relationship.After the absolute position of a described object changes, the relativepositional relationship may also change accordingly.

In order to keep the following description of the embodiments of thedisclosure clear and concise, the disclosure omits detailed descriptionof some known functions and known components.

In the binarization processing method in the prior art, the processingspeed of binarization processing is reduced when the size of an originalimage is relatively large, so an image compression ratio generally needsto be set according to processing speed and image quality. However, ifthe compression ratio is set to be larger, although the processing speedmay be improved, the quality of the final binary image may be poorer;and if the compression ratio is set to be smaller, although a binaryimage with better quality may be obtained, the processing speed isslower, that is, the process of performing binarization processing onthe original image is longer.

At least one embodiment of the disclosure provides an image processingmethod, an image processing device, an electronic apparatus, and anon-transitory computer-readable storage medium. The image processingmethod includes obtaining an original image, wherein the original imageincludes at least one object; performing slicing processing on theoriginal image to obtain multiple slice images of the original image;respectively processing the slice images through a first binarizationmodel to obtain multiple slice binary images respectively correspondingto the slice images; performing stitching processing on the slice binaryimages to obtain a first binary image; processing the first binary imageto obtain a pixel circumscribed contour image, wherein the pixelcircumscribed contour image includes multiple circumscribed contourpixels, and pixels in a region surrounded by the circumscribed contourpixels are pixels corresponding to at least a part of the at least oneobject; processing the original image through a second binarizationmodel to obtain a second binary image; and synthesizing the secondbinary image and the first binary image according to positions of thecircumscribed contour pixels in the pixel circumscribed contour image toobtain a synthetic image, wherein the synthetic image is a binary image.The image processing method can adopt a slicing processing manner on theoriginal image, divide the image with larger size into multiple sliceimages, and then respectively process the slice images to implement fastbinarization processing of the image and ensure image quality whileimproving image processing speed. As such, the image processing methodaccording to the embodiments of the disclosure may be applied to amobile terminal such as a mobile phone. On the basis of improvingprocessing speed, the original image does not need to be compressed, sothat image details are not lost while implementing real-time processingof an image acquired by the mobile phone.

In addition, the image processing method can convert an original image(for example, a color image or an unclear image) into a synthetic imagewith obvious and clear black and white contrast, which effectivelyimproves the quality of the synthetic image and improves the readabilityof the image content. Moreover, the converted synthetic image has lessnoise interference and obvious black and white contrast, therebyeffectively improving the printing effect.

It should be noted that the image processing method according to anembodiment of the disclosure may be applied to an image processingdevice according to an embodiment of the disclosure. The imageprocessing device may be configured on an electronic apparatus. Theelectronic apparatus may be a personal computer, a mobile terminal, etc.The mobile terminal may be a hardware apparatus with various operatingsystems, such as a mobile phone or a tablet computer.

The embodiments of the disclosure will be described in detail below withreference to the accompanying drawings, but the disclosure is notlimited to the specific embodiments.

FIG. 1 is a schematic flowchart of an image processing method accordingto at least one embodiment of the disclosure. FIG. 2 is a schematicdiagram of an original image according to at least one embodiment of thedisclosure.

For example, as shown in FIG. 1, the image processing method accordingto an embodiment of the disclosure includes Steps S110 to S170.

As shown in FIG. 1, firstly, Step S110 of the image processing methodincludes obtaining an original image.

For example, the original image includes at least one object. The objectmay be a character. The character may include Chinese (for example,Chinese character or pinyin), English, Japanese, French, Korean, Latin,numbers, etc. In addition, the object may also include various symbols(for example, greater-than sign, less-than sign, percent sign, etc.)various graphics, etc. The at least one object may include a printed ormachine input character and may also include a handwritten character.For example, as shown in FIG. 2, in some embodiments, an object in theoriginal image may include a printed word and letter (for example,English, Japanese, French, Korean, German, Latin, and other languagesand texts of different countries), a printed number (for example, date,weight, size, etc.), a printed symbol and image, a handwritten word andletter, a handwritten number, a handwritten symbol and graphics, etc.

For example, the original image may be various types of images, such asan image of a shopping list, an image of a catering receipt, an image ofa test paper, an image of a contract, etc. As shown in FIG. 2, theoriginal image 21 may be an image of a letter.

For example, the shape of the original image may be a rectangle, etc.The shape and size of the original image may be set by the useraccording to actual situations.

For example, the original image may be an image captured through animage acquisition device (for example, a digital camera, a mobile phone,etc.). The original image may be a grayscale image or a color image. Itshould be noted that the original image refers to a form of presentingan object to be processed (for example, a test paper, a contract, ashopping receipt, etc.) in a visual manner, such as an image of theobject to be processed. For another example, the original image may alsobe obtained through scanning. For example, the original image may be animage directly acquired by the image acquisition device or an imageobtained after preprocessing the collected image. For example, in orderto avoid the impact of data quality and data imbalance of the originalimage on image processing, before processing the original image, theimage processing method according to at least one embodiment of thedisclosure may further include an operation of preprocessing theoriginal image. Preprocessing may include, for example, performingcropping, gamma correction, noise reduction filtering, or otherprocessing on the image directly acquired by the image acquisitiondevice. Preprocessing may eliminate irrelevant information or noiseinformation in the original image, so that image processing may bebetter performed on the original image.

Next, in Step S120, slicing processing is performed on the originalimage to obtain multiple slice images of the original image.

For example, in at least one embodiment of the disclosure, as shown inFIG. 3, Step S120 of the image processing method may specificallyinclude Step S1201 to Step S1204.

In Step S1201, a first slice size and an extension slice size aredetermined.

For example, the first slice size is the actual slice size, that is, thesize of the slice image after the original image is sliced. The widthand the height corresponding to the first slice size are equal, and thewidth and the height corresponding to the first slice size may also benot equal. For example, in at least one embodiment of the disclosure,the first slice size may be 576×576. The first slice size may be setaccording to actual situations.

The extension slice size is the image extension size when the originalimage is sliced, which is set according to image processing requirementsand image processing effects. For example, in at least one embodiment ofthe disclosure, the extension slice size may be 48, 64, etc. Theextension slice size may be set according to actual situations. Forexample, when the extension slice size is 48, the image processingeffects are better. When the size is 64, the image processing effectsare better. However, the final target slice size (a second slice sizedescribed later) is smaller.

For example, during the process of image processing, the first slicesize and the extension slice size remain unchanged.

In Step S1202, the second slice size is determined according to thefirst slice size and the extension slice size.

For example, in at least one embodiment of the disclosure, when theextension slice size is a single-edge extension size, the widthcorresponding to the second slice size is the width corresponding to thefirst slice size minus twice the single-edge extension size, and theheight corresponding to the second slice size is the heightcorresponding to the first slice size minus twice the single-edgeextension size. For example, if the first slice size is 576×576 and theextension slice size is 48, the second slice size is 480×480. Whenslicing processing is performed on the original image, slicingprocessing is performed according to the first slice size, and the firstslice size is larger than the second slice size (the target slice size),so as to avoid losing edge details, so that there will be overlapbetween the slice images.

In Step S1203, a number of slices is determined according to the size ofthe original image and the second slice size.

The number of slices L is obtained through the following equation:

L=round(m/p)×round(n/q)   (1)

where the size of the original image is m×n, the second slice size isp×q, m is the width of the original image, n is the height of theoriginal image, p is the width corresponding to the second slice size, qis the height corresponding to the second slice size, and round(*)indicates a rounding function.

For example, in some examples, the size of the original image is1440×1440. It should be noted that the size of the original image is notlimited thereto and may be set according to actual situations. Thesecond slice size is 480×480, and the number of slices isL=round(1440/480)×round(1440/480)=9, that is, the original image isfinally sliced into 9 slice images. For another example, in some otherexamples, the size of the original image is 1000×1000, the second slicesize is 480×480, and the number of slices isL=round(1000/480)×round(1000/480)=4, that is, the original image isfinally sliced into 4 slice images.

In Step S1204, slicing processing is performed on the original imageaccording to the extension slice size, the second slice size, and thenumber of slices to obtain the slice images of the original image.

For example, in at least one embodiment of the disclosure, Step S1204includes determining an original image to be sliced based on theoriginal image according to the second slice size and the number ofslices; and performing slicing processing on the original image to besliced based on the second slice size and the extension slice size toobtain the slice images.

FIG. 4 is a schematic diagram of an original image to be slicedaccording to an embodiment of the disclosure. For example, the originalimage to be sliced 41 in FIG. 4 may be an image after size adjustment isperformed on the original image 21 in FIG. 2.

Determining the original image to be sliced based on the original imageaccording to the second slice size and the number of slices may includedetermining a size to be sliced according to the second slice size andthe number of slices; in response to the size of the original imagebeing the same as the size to be sliced, using the original image as theoriginal image to be sliced; and in response to the size of the originalimage being different from the size to be sliced, adjusting the size ofthe original image to obtain the original image to be sliced, whereinthe size of the original image to be sliced is the same as the size tobe sliced.

For example, the size to be sliced may be obtained through the followingcalculation equation:

H=round(n/q)×q   (2)

W=round(m/p)×p   (3)

where the size to be sliced is indicated as W×H, m is the width of theoriginal image, n is the height of the original image, p is the widthcorresponding to the second slice size, q is the height corresponding tothe second slice size, and round(*) is the rounding function. Forexample, the size of the original image to be sliced is the same as thesize to be sliced, so the size of the original image to be sliced isW×H, that is, the width of the original image to be sliced is W and theheight of the original image to be sliced is H.

For example, in some embodiments, when the original image may be slicedinto a whole relative to the second slice size, the original image maybe directly used as the original image to be sliced. For example, thesize of the original image is 1440×960 and the second slice size is480×480. The size to be sliced W (W=round(1440/480)×480)×H(H=round(960/480)x480) calculated according to the calculation equations(2) and (3) of the size to be sliced is 1440×960. At this time, the sizeof the original image is the same as the size to be sliced, so theoriginal image is used as the original image to be sliced.

For example, in other embodiments, when the original image cannot besliced into a whole relative to the second slice size, the originalimage may be directly adjusted to obtain the original image to besliced. For example, the size of the original image is 1500×1000, thesecond slice size is 480×480, and the size to be sliced W(W=round(1500/480)×480)×H (H=round(1000/480)×480) calculated accordingto the calculation equations (2) and (3) of the size to be sliced is1440×960. At this time, the size of the original image is different fromthe size to be sliced, so the size of the original image is adjusted to1440×960 to obtain the original image to be sliced.

FIG. 5a to FIG. 5c are schematic diagrams of a process of image slicingprocessing according to at least one embodiment of the disclosure. Asshown in FIG. 5a to FIG. 5c , the size of the original image is1440×1440, the first slice size is 576×576, the second slice size is480×480, and the extension slice size is 48. According to the abovedescription, the original image may be divided into 9 subregions, thatis, the original image may be sliced into 9 slice images. The number ineach subregion represents the numbering of the subregion, that is, aslice numbering.

It should be noted that in the embodiments of the disclosure, the unitof size is all pixels. In other words, for example, the first slice sizeis 576×576, which indicates that the first slice size is 576 pixels×576pixels.

For example, in some embodiments, in Step S1204, performing slicingprocessing on the original image to be sliced based on the second slicesize and the extension slice size to obtain the slice images may includedividing the original image to be sliced into the subregions accordingto the second slice size, wherein a number of subregions is equal to thenumber of slices; and then, slicing processing is performed on theoriginal image to be sliced according to the extension slice size andthe subregions to obtain the slice images. For example, the slice imagescorrespond to the subregions one-to-one, and the size of each sliceimage in the slice images is the first slice size and includes acorresponding subregion in the subregions.

For example, the original image includes four fixed edges. Eachsubregion in the subregions includes four region edges. Performingslicing processing on the original image to be sliced according to theextension slice size and the subregions to obtain the slice imagesincludes in response to all four region edges corresponding to an i-thsubregion in the subregions not overlapping with the four fixed edges,respectively extending the four region edges corresponding to the i-thsubregion by the extension slice size in a direction away from the i-thsubregion with the i-th subregion as a center to obtain a slice positioncorresponding to a slice image corresponding to the i-th subregion, andslicing the original image to be sliced according to the slice positionto obtain the slice image corresponding to the i-th subregion; inresponse to one region edge in four region edges corresponding to ani-th subregion in the subregions overlapping with one fixed edge in thefour fixed edges, extending a region edge opposite to the one regionedge in the four region edges by twice the extension slice size in adirection away from the i-th subregion, and respectively extendingregion edges adjacent to the one region edge in the four region edges bythe extension slice size in the direction away from the i-th subregionto obtain a slice position corresponding to a slice image correspondingto the i-th subregion, and slicing the original image to be slicedaccording to the slice position to obtain the slice image correspondingto the i-th subregion; or in response to two region edges in four regionedges corresponding to an i-th subregion in the subregions overlappingwith two fixed edges in the four fixed edges, extending other regionedges other than the two region edges in the four region edges by twicethe extension slice size in a direction away from the i-th subregion toobtain a slice position corresponding to a slice image corresponding tothe i-th subregion, and slicing the original image to be slicedaccording to the slice position to obtain the slice image correspondingto the i-th subregion.

For example, i is a positive integer and is less than or equal to thenumber of subregions.

For example, as shown in FIG. 5a , in some embodiments, in the casewhere all four region edges corresponding to the i-th subregion in thesubregions do not overlap with the four fixed edges, for example, for asubregion numbered 5 in the subregions, that is, when i is 5, all fourregion edges corresponding to the i-th subregion do not overlap with thefour fixed edges. At this time, the four region edges corresponding tothe i-th subregion are respectively extended by the extension slice sizein a direction away from the i-th subregion with the i-th subregion asthe center to obtain the slice position corresponding to the slice imagecorresponding to the i-th subregion, and the original image to be slicedis sliced according to the slice position to obtain the slice imagecorresponding to the i-th subregion. For example, in some examples, thesize of the 5-th subregion is 480×480. The four region edges of the 5-thsubregion are respectively extended by 48 pixels in the direction awayfrom the 5-th subregion to obtain a dashed frame containing four dashedlines in FIG. 5a , that is, the slice position. A region defined by thedashed frame is the region of the slice image corresponding to the 5-thsubregion. The original image to be sliced is sliced according to theslice position to obtain the slice image corresponding to the 5-thsubregion. The size of the slice image is 576×576.

For example, as shown in FIG. 5b , in some embodiments, in the casewhere one region edge in the four region edges corresponding to the i-thsubregion in the subregions overlaps with one fixed edge in the fourfixed edges, for example, for subregions numbered 2, 4, 6, and 8 in thesubregions, that is, when i is 2, 4, 6 and 8, only one region edge inthe four region edges corresponding to the i-th subregion overlaps withone fixed edge in the four fixed edges. At this time, the region edgeopposite to the one region edge in the four region edges is extended bytwice the extension slice size in the direction away from the i-thsubregion, and the region edges adjacent to the one region edge in thefour region edges are respectively extended by the extension slice sizein the direction away from the i-th subregion to obtain the sliceposition corresponding to the slice image corresponding to the i-thsubregion, and the original image to be sliced is sliced according tothe slice position to obtain the slice image corresponding to the i-thsubregion. For example, taking i being 2 as an example, the size of the2-nd subregion is 480×480. An upper region edge of the 2-nd subregionoverlaps with an upper fixed edge in the four fixed edges. At this time,the upper region edge of the 2-nd subregion remains unchanged. A lowerregion edge of the 2-nd subregion is extended downward (that is,extended in a direction away from the upper region edge of the 2-ndsubregion) by twice the extension slice size, that is, 96 pixels. A leftregion edge of the 2-nd subregion is extended leftward (that is,extended in a direction away from a right region edge of the 2-ndsubregion) by the extension slice size, that is, 48 pixels. The rightregion edge of the 2-nd subregion is extended rightward (that is,extended in a direction away from the left region edge of the 2-ndsubregion) by the extension slice size, that is, 48 pixels. As such, adashed frame containing three dashed lines in FIG. 5b , that is, theslice position, may be obtained. A region defined by the dashed frameand the upper fixed edge in the four fixed edges is the region of theslice image corresponding to the 2-nd subregion. The original image tobe sliced is sliced according to the slice position to obtain the sliceimage corresponding to the 2-nd subregion. The size of the slice imageis 576×576.

For example, as shown in FIG. 5b , a left region edge of the 4-thsubregion overlaps with a left fixed edge in the four fixed edges, aright region edge of the 6-th subregion overlaps with a right fixed edgein the four fixed edges, and a lower region edge of the 8-th subregionoverlaps with a lower fixed edge in the four fixed edges.

For example, as shown in FIG. 5c , in some embodiments, in the casewhere two region edges in the four region edges corresponding to thei-th subregion in the subregions overlap with two fixed edges in thefour fixed edges, for example, for subregions numbered 1, 3, 7, and 9 inthe subregions, that is, when i is 1, 3, 7, and 9, two region edges inthe four region edges corresponding to the i-th subregion overlap withtwo fixed edges in the four fixed edges. At this time, other regionedges other than the two region edges in the four region edges areextended by twice the extension slice size in the direction away fromthe i-th subregion to obtain the slice position corresponding to theslice image corresponding to the i-th subregion, and the original imageto be sliced is sliced according to the slice position to obtain theslice image corresponding to the i-th subregion. For example, taking ibeing 1 as an example, the size of the 1-st subregion is 480×480. Anupper region edge and a left region edge of the 1-st subregion remainunchanged. A right region edge of the 1-st subregion is extendedrightward (that is, extended in a direction away from the right regionedge of the 1-st subregion) by twice the extension slice size, that is,96 pixels. A lower region edge of the 1-st subregion is extendeddownward (that is, extended in a direction away from the lower regionedge of the 1-st subregion) by twice the extension slice size, that is,96 pixels. As such, a dashed frame containing two dashed lines in FIG.5c , that is, the slice position, may be obtained. A region defined bythe dashed frame and the upper fixed edge and the left fixed edge in thefour fixed edges is the region of the slice image corresponding to the1-st subregion. The original image to be sliced is sliced according tothe slice position to obtain the slice image corresponding to the 1-stsubregion. The size of the slice image is 576×576.

It should be noted that in the embodiments of the disclosure, the upperregion edge and the lower region edge are two region edges opposite toeach other, and the left region edge and the right region edge are tworegion edges opposite to each other. The “upper”, “lower”, “left”, and“right” are divided from the perspective of the viewer.

According to the slicing processing manner of the embodiment, theoriginal image with a larger size may be divided into multiple slicesfor processing, which can ensure image processing speed while ensuringimage quality to solve the issue that the image compression mannercannot balance processing speed and image quality. In addition, adoptingthe slicing manner in which there is overlap between the slice imagesenables the edge details of the slice images to be preserved and imagequality to be improved.

For example, in some embodiments, in the case where the number of sliceimages corresponding to the original image is 1 and the size of theoriginal image is smaller than the second slice size, for example, thesize of the original image is 480×360 and the second slice size is480×480, the number of slices calculated according to the calculationequation (1) of the number of slices is 1, that is, the original imageis finally sliced into 1 slice image. At this time, the size of theoriginal image needs to be extended to the second slice size, that is,the size of the original image is extended to 480×480 to obtain theoriginal image to be sliced, that is, the size of the original image tobe sliced is 480×480. When performing slicing processing on the originalimage to be sliced, since the size of the slice image is the first slicesize (for example, 576×576), the size of the original image to be slicedneeds to be extended to the first slice size, that is, the size of theoriginal image to be sliced is extended to 576×576 to obtain a sliceimage corresponding to the original image.

For example, in other embodiments, when the number of slice imagescorresponding to the original image is 1 and the size of the originalimage is larger than the second slice size, for example, the size of theoriginal image is 600×490 and the second slice size is 480×480, thenumber of slices calculated according to the calculation equation (1) ofthe number of slices is 1, that is, the original image is finally slicedinto 1 slice image. At this time, the size of the original image needsto be reduced to the second slice size, that is, the size of theoriginal image is adjusted to 480×480 to obtain the original image to besliced, that is, the size of the original image to be sliced is 480×480.When performing slicing processing on the original image to be sliced,since the size of the slice image is the first slice size (for example,576×576), the size of the original image to be sliced needs to beextended to the first slice size, that is, the size of the originalimage to be sliced is extended to 576×576 to obtain a slice imagecorresponding to the original image.

For example, in other embodiments, one of round(m/p) and round(n/q) inthe calculation equation (1) of the number of slices is 1, and the otherone is greater than 1 (for example, 2, 3, etc.). At this time, theoriginal image to be sliced needs to be sliced according to the secondslice size to obtain multiple intermediate slice images. Then, the sizeof the intermediate slice images is extended to the first slice size toobtain the slice images corresponding to the original image. Forexample, in an example, the original image size is 1500×480 and thesecond slice size is 480×480, the number of slices calculated accordingto the calculation equation (1) of the number of slices isL=round(1500/480)×round(480/480)=3, that is, the original image isfinally sliced into 3 slice images. The size to be sliced is calculatedto be 1440×480 according to the calculation equations (2) and (3) of thesize to be sliced, so the size of the original image needs to beadjusted to 1440×480 to obtain the original image to be sliced with thesize of 1440×480. When performing slicing processing on the originalimage to be sliced, the original image to be sliced is sliced into 3intermediate slice images according to the second slice size. The sizeof each intermediate slice image is the second slice size, that is,480×480. Then, the size of each intermediate slice image is extended tothe first slice size, that is, 576×576 to obtain 3 slice images.

Next, as shown in FIG. 1, in Step S130, the slice images arerespectively processed through a first binarization model to obtainmultiple slice binary images respectively corresponding to the sliceimages.

For example, the first binarization model is a model based on a neuralnetwork. For example, the first binarization model may be implemented byadopting machine learning technology and may be, for example, run on ageneral-purpose computing device or a special-purpose computing device.The first binarization model is a neural network model obtained bypre-training. For example, the first binarization model may beimplemented by adopting a neural network such as a U-Net neural network,a neural network similar to the U-Net neural network, and a Mask R-CNNneural network.

For example, the first binarization model is used to performbinarization processing on the original image to obtain a first binaryimage. Binarization processing is to set the grayscale value of pixelson the original image to a first grayscale value (for example, 0) or asecond grayscale value (for example, 255), that is, a process for theentire original image to present an obvious black and white effect.

For example, a first binarization model to be trained may be trainedthrough a large number of original training images and images of theoriginal training images after binarization. Then, the firstbinarization model (for example, the neural network model such as theU-Net neural network) is established. For the process of training thefirst binarization model to be trained to establish the firstbinarization model, reference may be made to the training process in theneural network field, and the specific process will not be repeated.

It should be noted that in some embodiments, an existing binarizationprocessing manner may also be adopted to perform binarization processingon the original image to obtain the first binary image. For example, thebinarization processing manner may include a threshold method. Thethreshold method includes setting a binarization threshold, andcomparing a grayscale value of each pixel in an original image to thebinarization threshold. If the grayscale value of a certain pixel in theoriginal image is greater than or equal to the binarization threshold,the grayscale value of the pixel is set to 255 grayscale. If thegrayscale value of a certain pixel in the original image is less thanthe binarization threshold, the grayscale value of the pixel is set to 0grayscale. As such, the performance of binarization processing on theoriginal image may be implemented. For example, a selection method ofthe binarization threshold includes a bimodal method, a P-parametermethod, a big law method (Otsu's method), a maximum entropy method, aniterative method, etc.

For example, FIGS. 6a to 6i are slice binary images after performingslicing processing and binarization processing on an original imageaccording to at least one embodiment of the disclosure. For example, theimages in FIGS. 6a to 6i may be the slice binary images 61-69 afterprocessing the original image to be sliced 41 in FIG. 4 according toStep S120 and Step S130.

The original image to be sliced is sliced into 9 slice images. Then,binarization processing is respectively performed on the 9 slice imagesto obtain 9 slice binary images, which respectively correspond to theslice binary images 61-69. For example, the original image to be sliced41 shown in FIG. 4 is sliced according to the slicing manner shown inFIGS. 5a to 5c to obtain the slice images. The slice images arerespectively processed according to Step 130 to obtain the correspondingslice binary images. The slice binary images corresponding to thesubregions numbered 1 to 9 shown in FIGS. 5a to 5c respectivelycorrespond to the slice binary images 61-69. In other words, the slicebinary image 61 shown in FIG. 6a corresponds to a part in the originalimage to be sliced 41 shown in FIG. 4 that corresponds to the subregionnumbered 1, and so on.

Next, as shown in FIG. 1, in Step S140, stitching processing isperformed on the slice binary images to obtain the first binary image.

For example, in at least one embodiment of the disclosure, as shown inFIG. 7a , Step S140 of the image processing method may specificallyinclude Step S1401 to Step S1403.

In Step S1401, a positional relationship of the slice binary images isdetermined according to a positional relationship of the subregions inthe original image to be sliced.

In Step S1402, stitching processing is performed on the slice binaryimages based on the positional relationship of the slice binary imagesto obtain a binary prediction image.

In Step S1403, in response to the size of the binary prediction imagebeing not equal to the size of the original image, size restorationprocessing is performed on the binary prediction image to obtain thefirst binary image, and in response to the size of the binary predictionimage being equal to the size of the original image, the binaryprediction image is used as the first binary image.

For example, the size of the first binary image is the same as the sizeof the original image.

For example, in at least one embodiment of the disclosure, all pixels inthe first binary image are arranged in n rows and m columns. Step S1402includes performing stitching processing on the slice binary imagesbased on the positional relationship of the slice binary images toobtain an intermediate binary prediction image, wherein all pixels inthe intermediate binary prediction image are also arranged in n rows andm columns; in response to a t1-th row and a t2-th column in theintermediate binary prediction image including only one pixel, using agrayscale value of the one pixel located in the t1-th row and the t2-thcolumn as a grayscale value of a pixel in a t1-th row and a t2-th columnin the binary prediction image; and in response to the t1-th row and thet2-th column in the intermediate binary prediction image includingmultiple pixels, performing OR operation on grayscale values of thepixels located in the t1-th row and the t2-th column to obtain grayscalevalues of pixels in the t1-th row and the t2-th column in the binaryprediction image.

For example, n, m, t1, and t2 are all positive integers, t1 is less thanor equal to n, and t2 is less than or equal to m.

FIG. 7b is a schematic diagram of an intermediate binary predictionimage according to at least one embodiment of the disclosure. Forexample, shaded regions in FIG. 7b indicate overlapping regions formedbetween the slice binary images due to size extension during the processof stitching.

For example, in some embodiments, the pixel located in the t1-th row andthe t2-th column is a point P1 in FIG. 7b , and the point P1 is acertain pixel in the overlapping region between a slice binary imagenumbered 1 and a slice binary image numbered 2. At this time, there are2 pixels located in the t1-th row and the t2-th column (that is, thepoint P1) in the intermediate binary prediction image. The 2 pixels arerespectively a pixel located in a t1-th row and a t2-th column in theslice binary image numbered 1 and a pixel located in a t1-th row and at2-th column in the slice binary image numbered 2. For example, in otherembodiments, the pixel located in the t1-th row and the t2-th column isa point P2 in FIG. 7b , and the point P2 is a certain pixel in theoverlapping region between the slice binary image numbered 1, the slicebinary image numbered 2, a slice binary image numbered 4, and a slicebinary image numbered 5. At this time, there are 4 pixels located in thet1-th row and the t2-th column (that is, the point P2) in theintermediate binary prediction image. The 4 pixels are respectively apixel located in the t1-th row and the t2-th column in the slice binaryimage numbered 1, a pixel located in the t1-th row and the t2-th columnin the slice binary image numbered 2, a pixel located in a t1-th row anda t2-th column in the slice binary image numbered 4, and a pixel locatedin a t1-th row and a t2-th column in the slice binary image numbered 5.For example, in other embodiments, the pixel located in the t1-th rowand the t2-th column is a point P3 in FIG. 7b , and the point P3 is acertain pixel in a non-overlapping region (for example, in the exampleshown in FIG. 7b , the point P3 is a certain pixel in a non-overlappingregion in the slice binary image numbered 2, but not limited thereto,the point P3 is a certain pixel in a non-overlapping region in the slicebinary image numbered 1). At this time, there is one pixel located inthe t1-th row and the t2-th column (that is, the point P3) in theintermediate binary prediction image. In FIG. 7b , a dot-dashed frameindicates the slice binary image numbered 1, a dashed frame indicatesthe slice binary image numbered 2, and a solid frame indicates a part ofeach slice binary image corresponding to the subregion in the sliceimage.

For example, taking the subregions numbered 1 and 2 in FIG. 5a and thetwo slice binary images numbered 1 and 2 in FIG. 7b as examples fordescription. Two slice images corresponding to the subregion numbered 1and the subregion numbered 2 in FIG. 5a are respectively processedthrough the first binarization model to obtain the slice binary imagescorresponding to the two slice images, that is, the slice binary imagenumbered 1 and the slice binary image numbered 2. The slice binary imagenumbered 1 and the slice binary image numbered 2 are arranged accordingto the positional relationship between the subregion numbered 1 and thesubregion numbered 2 in the original image. It should be noted that whenperforming stitching processing, since the slice image is obtainedthrough slicing the original image based on the extension slice size andthe second slice size, and the subregion numbered 1 and the subregionnumbered 2 are adjacent subregions, the slice binary image correspondingto the subregion numbered 1 and the slice binary image corresponding tothe subregion numbered 2 have an overlapping region, as shown by ashaded region between the slice binary image numbered 1 and the slicebinary image numbered 2 in FIG. 7 b.

For example, as shown in FIG. 7b , in an example, when the pixelslocated in the t1-th row and the t2-th column in the intermediate binaryprediction image are pixels at the point P1 in the overlapping region inFIG. 7b , the point P1 has a pixel (for example, a first pixel) in theslice binary image numbered 1 and a pixel (for example, a second pixel)in the slice binary image numbered 2. OR operation is performed ongrayscale values of the pixels (that is, the first pixel and the secondpixel) at the point P1 to be used as grayscale values of the pixelslocated in the t1-th row and the t2-th column in the binary predictionimage. For example, in another example, when the pixels located in thet1-th row and the t2-th column in the intermediate binary predictionimage are pixels at the point P2 in the overlapping region in FIG. 7b ,the point P2 has the pixel (for example, the first pixel) in the slicebinary image numbered 1, the pixel (for example, the second pixel) inthe slice binary image numbered 2, a pixel (for example, a third pixel)in the slice binary image numbered 4, and a pixel (for example, a fourthpixel) in the slice binary image numbered 5. OR operation is performedon grayscale values of the pixels (that is, the first pixel, the secondpixel, the third pixel, and the fourth pixel) at the point P2 to be usedas the grayscale values of the pixels located in the t1-th row and thet2-th column in the binary prediction image. For example, in anotherexample, when a pixel located in the t1-th row and the t2-th column inthe intermediate binary prediction image is a pixel at the point P3 inthe non-overlapping region in FIG. 7b , the point P3 has the pixel (forexample, the first pixel) in the slice binary image numbered 2. Thepixel (that is, the first pixel) at the point P3 is used as thegrayscale value of the pixel located in the t1-th row and the t2-thcolumn in the binary prediction image.

In the embodiment, the grayscale values of the pixels in the overlappingregions are calculated in the manner of OR operation, which may mergeedge features of different slice binary images to improve image quality.

For example, in at least one embodiment of the disclosure, Step S1402includes extracting a part in each slice binary image corresponding tothe subregion in the corresponding slice image to be used as anintermediate slice binary image of the slice binary image; andperforming stitching processing on the intermediate slice binary imagescorresponding to the slice binary images based on the positionalrelationship of the slice binary images to obtain the binary predictionimage.

For example, taking the subregion numbered 1 in FIG. 5a and the slicebinary image numbered 1 in FIG. 7b as examples, the process of obtainingthe intermediate slice binary image and performing stitching processingon the intermediate slice binary image will be described. The sliceimage corresponding to the subregion numbered 1 is processed through thefirst binarization model to obtain the corresponding slice binary imagethereof, that is, the slice binary image numbered 1. A part of the slicebinary image numbered 1 corresponding to the subregion of the sliceimage numbered 1, that is, a solid frame part in the slice binary imagenumbered 1 shown in FIG. 7b is extracted to obtain an intermediate slicebinary image numbered 1. After processing all slice binary images, theintermediate slice binary images corresponding to all slice binaryimages are obtained. Then, all intermediate slice binary images arearranged according to the positional relationship of all slice binaryimages in the original image to obtain the binary prediction image.

For example, in some embodiments, in Step S1403, an interpolation methodmay be adopted to perform size restoration processing on the binaryprediction image to obtain the first binary image. For example, if thesize of the binary prediction image is 1440×960 and the size of theoriginal image is 1500×1000, size restoration processing is performed onthe binary prediction image, that is, the size of the binary predictionimage is adjusted to 1500×1000 to obtain the first binary image.

For example, in Step S1403, if the size of the binary prediction imageis 1440×960 and the size of the original image is also 1440×960, thebinary prediction image is directly used as the first binary image.

For example, according to at least one embodiment of the disclosure,Step S120 may also be determining the second slice size; determining thenumber of slices according to the size of the original image and thesecond slice size; and performing slicing processing on the originalimage according to the second slice size and the number of slices toobtain the slice images of the original image, wherein the number ofslice images is equal to the number of slices and the size of each sliceimage in the slice images is the second slice size. Performing slicingprocessing on the original image according to the second slice size andthe number of slices to obtain the slice images of the original imageincludes determining the original image to be sliced based on theoriginal image according to the second slice size and the number ofslices; and performing slicing processing on the original image to besliced based on the second slice size to obtain the slice images.

For example, the number of slice images is equal to the number of slicesand the size of each slice image in the slice images is the second slicesize. In other words, there is no need to perform size extensionprocessing on the second slice size at this time, and the original imageis sliced directly based on the second slice size. There is nooverlapping part between the slice images.

At this time, Step S140 includes determining the positional relationshipof the slice binary images according to the positional relationship ofthe slice images in the original image to be sliced; performingstitching processing on the slice binary images based on the positionalrelationship of the slice binary images to obtain the binary predictionimage; and in response to the size of the binary prediction image beingnot equal to the size of the original image, performing size restorationprocessing on the binary prediction image to obtain the first binaryimage, and in response to the size of the binary prediction image beingequal to the size of the original image, using the binary predictionimage as the first binary image. In the embodiment, there is nooverlapping part between the slice binary images, so there is no casewhere the same pixel corresponds to two grayscale values in the binaryprediction image obtained by stitching the slice binary images.

For example, the size of the first binary image is the same as the sizeof the original image.

In the embodiment, slicing processing is performed on the originalimage, and the original image with a larger size is divided intomultiple slices for processing, which can ensure image processing speedwhile ensuring image quality to solve the issue that the imagecompression manner cannot balance processing speed and image quality.The size of the original image to be sliced is adjusted to ensure thatthe size of all slice images is the first slice size to improve imageprocessing efficiency.

FIG. 8 is a schematic diagram of a first binary image according to anembodiment of the disclosure. For example, FIG. 8 is the first binaryimage 81 obtained by processing the slice binary images 61-69 of FIGS.6a to 6i according to Step S140, which is also the first binary image 81of the original image 21 shown in FIG. 2. For example, as shown in FIG.8, in the first binary image 81, black pixels indicate pixelscorresponding to an object and white pixels indicate pixelscorresponding to a background.

FIG. 9 is a schematic diagram of a blur image according to an embodimentof the disclosure. FIG. 10 is a pixel circumscribed contour imageaccording to an embodiment of the disclosure.

Next, as shown in FIG. 1, in Step S150, the first binary image isprocessed to obtain the pixel circumscribed contour image.

For example, the pixel circumscribed contour image 83 shown in FIG. 10is the pixel circumscribed contour image obtained after processing thefirst binary image 81 shown in FIG. 8.

For example, as shown in FIG. 10, the pixel circumscribed contour image83 includes multiple circumscribed contour pixels. White pixels in thepixel circumscribed contour image 83 indicate the circumscribed contourpixels. Pixels in a region surrounded by the circumscribed contourpixels are pixels corresponding to at least a part of at least oneobject. Black pixels inside the white pixels in the pixel circumscribedcontour image 83 indicate pixels of the object.

For example, in some embodiments, Step S150 includes performing blurringprocessing on the first binary image to obtain the blur image; andperforming XOR processing on the blur image and the first binary imageto obtain the pixel circumscribed contour image.

For example, the blur image 82 shown in FIG. 9 may be the blur imageobtained after performing blurring processing on the first binary image81 shown in FIG. 8. As shown in FIG. 8 and FIG. 9, after performingblurring processing on the first binary image 81, a mask region of theobject in the first binary image becomes larger.

For example, in some embodiments, Gaussian filtering may be adopted toperform blurring processing on the first binary image. It should benoted that in the disclosure, the method of blurring processing is notlimited to Gaussian filtering and may also be other suitable methods,such as median filtering and mean filtering.

For example, the white pixels in the pixel circumscribed contour image83 indicate different pixels between the blur image and the first binaryimage. In other words, for any white pixel in the pixel circumscribedcontour image 83, a grayscale value of a pixel at a positioncorresponding to the white pixel in the blur image is different from agrayscale value of a pixel at a position corresponding to the whitepixel in the first binary image. The black pixels in the pixelcircumscribed contour image 83 indicate the same pixels between the blurimage and the first binary image. In other words, for any black pixel inthe pixel circumscribed contour image 83, a grayscale value of a pixelat a position corresponding to the black pixel in the blur image is thesame as a grayscale value of a pixel at a position corresponding to theblack pixel in the first binary image.

FIG. 11 is a schematic diagram of a second binary image according to anembodiment of the disclosure.

Next, as shown in FIG. 1, in Step S160, the original image is processedthrough a second binarization model to obtain the second binary image.

For example, the second binary image 84 shown in FIG. 11 is the imageobtained after processing the original image 21 shown in FIG. 2 throughthe second binarization model.

For example, in Step S160, processing performed by the secondbinarization model (for example, less ink processing) is based on theoriginal image. For example, processing performed by the secondbinarization model may be used to remove a part of the grayscale pixelsin the original image while enhancing detail information of the object(for example, the character), that is, preserving more detailed pixelfeatures. Processing performed by the second binarization model may alsoremove image noise interference in the original image, so that detailsof the object are more prominent.

For example, in some embodiments, Step S160 may include performinggrayscale processing on the original image to obtain a grayscale image;processing the grayscale image according to a first threshold to obtainan intermediate binary image; performing guiding filtering processing onthe grayscale image by using the intermediate binary image as a guidingimage to obtain a filter image; determining a high-value pixel in thefilter image according to the second threshold, wherein a grayscalevalue of the high-value pixel is greater than the second threshold;performing expanding processing on the grayscale value of the high-valuepixel according to a preset expansion coefficient to obtain an expansionimage; performing sharpening processing on the expansion image to obtaina clear image; and adjusting a contrast of the clear image to obtain thesecond binary image.

For example, the method of grayscale processing includes a componentmethod, a maximum value method, an average value method, a weightedaverage method, etc.

For example, a threshold method may be adopted to perform binarizationprocessing on the grayscale image to obtain the intermediate binaryimage. For example, a conventional selection method of a binarizationthreshold includes a bimodal method, a P-parameter method, a big lawmethod (Otsu's method), a maximum entropy method, an iterative method,etc. A selection method of a first threshold may adopt any one of themethods. The first threshold may be set according to actual situations,which are not specifically limited here.

For example, the intermediate binary image is used as the guiding imagein guiding filtering processing, the grayscale image is used as an inputimage in guiding filtering processing, and the filter image is used asan output image in guiding filtering processing. As such, by performingguiding filtering processing on the grayscale image through theintermediate binary image, the filter image substantially similar to thegrayscale image and with edge texture similar to the intermediate binaryimage may be output. After guiding filtering processing, noise in theimage is significantly reduced.

For example, the second threshold is a sum of a grayscale mean andstandard deviations of grayscale values of the filter image, that is,the second threshold is equal to an average value of the grayscale valueof each pixel in the filter image plus the standard deviation of thegrayscale value of each pixel in the filter image.

For example, in some embodiments, the preset expansion coefficient is1.2 to 1.5, for example, 1.3. The grayscale value of each high-valuepixel is multiplied by the preset expansion coefficient to performexpanding processing on the grayscale value of the high-value pixel,thereby obtaining the expansion image with more obvious black and whitecontrast.

For example, in Step S160, in some embodiments, performing sharpeningprocessing on the expansion image to obtain the clear image includesperforming blurring processing on the expansion image by adoptingGaussian filtering to obtain the blur image corresponding to theexpansion image; and mixing the blur image corresponding to theexpansion image and the expansion image in proportion according to apreset mixing coefficient to obtain the clear image. Through performingsharpening processing on the expansion image, the clear image clearerthan the expansion image may be obtained.

For example, in Step S160, adjusting the contrast of the clear imageincludes adjusting the grayscale value of each pixel of the clear imageaccording to the grayscale mean of the clear image. Therefore, throughadjusting the contrast of the clear image, the second binary image withmore obvious black and white contrast may be obtained.

FIG. 12 is a schematic diagram of a synthetic image according to anembodiment of the disclosure. For example, FIG. 12 is an image ofsynthesizing of the first binary image 81 shown in FIG. 8 and the secondbinary image 84 shown in FIG. 11. For example, as shown in FIG. 12, thesynthetic image 85 is a binary image.

Finally, as shown in FIG. 1, in Step S170, the second binary image andthe first binary image are synthesized according to positions of thecircumscribed contour pixels in the pixel circumscribed contour image toobtain the synthetic image.

It should be noted that “synthesizing the second binary image and thefirst binary image to obtain the synthetic image” indicates replacinggrayscale values of pixels in the first binary image corresponding tothe positions of the circumscribed contour pixels with grayscale valuesof pixels in the second binary image corresponding to the positions ofthe circumscribed contour pixels, that is, replacing all pixels in thefirst binary image corresponding to the positions of the circumscribedcontour pixels with pixels with better effects.

For example, in some embodiments, Step S170 includes obtaining thepositions of the circumscribed contour pixels in the pixel circumscribedcontour image; extracting multiple target second binary pixels atpositions in the second binary image corresponding to the positions ofthe circumscribed contour pixels; and respectively synthesizing thetarget second binary pixels in the second binary image to same positionsin the first binary image according to a pixel correspondence betweenthe second binary image and the first binary image to obtain thesynthetic image of the original image.

FIG. 13a is a synthetic image 86 with black edges according to anembodiment of the disclosure. FIG. 13b is a synthetic image 87 withblack edges removed according to an embodiment of the disclosure.

As shown in FIG. 13a , there are black regions generated during theprocess of image processing in the black borders at the lower leftcorner and the lower right corner of the synthetic image 86, that is,parts indicated by black pixels in the black borders.

Since black edges generated during the process of image processingaffects image quality and aesthetics, black edge removal processingneeds to be performed on the synthetic image with black edges. Forexample, in an example, the image processing method further includesperforming black edge removal processing on the synthetic image, thatis, performing clearing processing on the black regions in the edgeregions of the synthetic image, that is, changing grayscale values ofpixels of the black regions in the edge regions of the synthetic imageto grayscale values of background pixels. It is worth noting that in theembodiments of the disclosure, if the background pixel is a black pixel,that is, the grayscale value of the background pixel is 0, at this time,performing black edge removal processing on the synthetic imageindicates changing a grayscale value of each white pixel in a regioncomposed of white pixels whose size exceeds a preset threshold in theedge region to 0, that is, a preset grayscale value is 0 at this time.

For example, performing black edge removal processing on the syntheticimage includes determining the edge region of the synthetic image;traversing the edge region of the synthetic image to judge whether thereis a black region whose size exceeds the preset threshold; and inresponse to the edge region including at least one black region whosesize exceeds the preset threshold, setting a grayscale value of a pixelcorresponding to the at least one black region to the preset grayscalevalue.

For example, determining the edge region of the synthetic image mayinclude identifying an image content region of the synthetic image, andusing a part of the synthetic image excluding the image content regionas the edge region. For example, determining the edge region of thesynthetic image may include identifying the image content region of thesynthetic image, and extending outward by a first preset size with theimage content region as a center to obtain an extension image region;using a part of the synthetic image excluding the extension image regionas the edge region. For example, determining the edge region of thesynthetic image may include using a partial region extending from anedge of the synthetic image to a center of the synthetic image by asecond preset size as the edge region. It should be noted that the size,determination method, etc. of the edge region are not limited by thedisclosure.

For example, the edge region is traversed. If there are continuous blackpixels, and the number of continuous black pixels exceeds a presetthreshold (for example, the preset threshold may be 2 pixels), thecontinuous black pixels are the black region that needs to be removed.Then, a grayscale value of each pixel in the black region is set to thepreset grayscale value. The preset grayscale value may be the grayscalevalue of the background pixel. For example, in some examples, thebackground pixel may be a white pixel. At this time, the presetgrayscale value is 255.

For example, in an example, the top, bottom, left, and right edges ofthe synthetic image are respectively traversed. For example, rowscanning and column scanning are started from the four edges of thesynthetic image to judge whether there are continuous black pixels, andthe number of black pixels exceeds the preset threshold. For example, ascan line function is adopted to start traversing from the edge of thesynthetic image row by row and column by column. When a black pixel isscanned, recording starts, and the black pixel is used as a startingpoint of the black region. When a grayscale value of a pixel in the nextrow (or the next column) adjacent to the black pixel is 0, the pixeladjacent to the black pixel is used as a part of the black region. Then,scanning continues. When a grayscale value of a pixel in the next row(or the next column) adjacent to the black region is not 0, a boundaryof the black region has been traversed, and scanning stops. Whether thesize of the black region exceeds the preset threshold is judged. If thesize of the black region exceeds the preset threshold, a grayscale valueof each pixel in the black region is set to the preset grayscale value.If the size of the black region does not exceed the preset threshold,the grayscale value of each pixel in the black region remains unchanged.

In the embodiment, the image is traversed in a manner of row scanningand column scanning without pre-defining the edge region, so theimplementation manner thereof is simpler and easier to operate.

It should be noted that the synthetic image in the embodiment may be asynthetic image obtained after being processed according to theembodiment or may be another binary target image, which is not limitedby the disclosure.

It should be noted that in the disclosure, the pixels in the secondbinary image are referred to as the second binary pixels, the pixels inthe first binary image are referred to as the first binary pixels, andthe pixels in the synthetic image are referred to as synthetic pixels.The “second binary pixels”, “first binary pixels”, “synthetic pixels”,etc. are only used to distinguish pixels located in different images anddo not indicate that the structures, properties, etc. of the pixels aredifferent.

Corresponding to the image processing method, at least one embodiment ofthe disclosure further provides an image processing device. FIG. 14 is aschematic block diagram of an image processing device according to atleast one embodiment of the disclosure.

For example, as shown in FIG. 14, an image processing device 1400includes an obtaining module 1401, a slicing module 1402, a firstbinarization module 1403, a stitching module 1404, a processing module1405, a second binarization module 1406, and a synthesis module 1407.

The obtaining module 1401 is configured to obtain an original image. Forexample, the original image includes at least one object.

The slicing module 1402 is configured to perform slicing processing onthe original image to obtain multiple slice images of the originalimage.

The first binarization module 1403 is configured to respectively processthe slice images through a first binarization model to obtain multipleslice binary images respectively corresponding to the slice images.

The stitching module 1404 is configured to perform stitching processingon the slice binary images to obtain a first binary image.

The processing module 1405 is configured to process the first binaryimage to obtain a pixel circumscribed contour image. For example, thepixel circumscribed contour image includes multiple circumscribedcontour pixels. Pixels in a region surrounded by the circumscribedcontour pixels are pixels corresponding to at least a part of the atleast one object.

The second binarization module 1406 is configured to process theoriginal image through a second binarization model to obtain a secondbinary image.

The synthesis module 1407 is configured to synthesize the second binaryimage and the first binary image according to positions of thecircumscribed contour pixels in the pixel circumscribed contour image toobtain a synthetic image. For example, the synthetic image is a binaryimage.

For example, the obtaining module 1401, the slicing module 1402, thefirst binarization module 1403, the stitching module 1404, theprocessing module 1405, the second binarization module 1406, and/or thesynthesis module 1407 include codes and programs stored in a memory. Aprocessor may execute the codes and the programs to implement some orall of the functions of the obtaining module 1401, the slicing module1402, the first binarization module 1403, the stitching module 1404, theprocessing module 1405, the second binarization module 1406, and/or thesynthesis module 1407. For example, the obtaining module 1401, theslicing module 1402, the first binarization module 1403, the stitchingmodule 1404, the processing module 1405, the second binarization module1406, and/or the synthesis module 1407 may be special-purpose hardwaredevices to implement some or all of the functions of the obtainingmodule 1401, the slicing module 1402, the first binarization module1403, the combined module 1404, the processing module 1405, the secondbinarization module 1406, and/or the synthesis module 1407. For example,the obtaining module 1401, the slicing module 1402, the firstbinarization module 1403, the stitching module 1404, the processingmodule 1405, the second binarization module 1406, and/or the synthesismodule 1407 may be one circuit board or a combination of multiplecircuit boards to implement the functions. In the embodiment of thedisclosure, the one circuit board or the combination of the circuitboards may include (1) one or more processors; (2) one or morenon-transitory memories connected to the processors; and (3) firmwarestored in the memories executable by the processors.

It should be noted that the obtaining module 1401 is configured toimplement Step S110 shown in FIG. 1, the slicing module 1402 isconfigured to implement Step S120 shown in FIG. 1, the firstbinarization module 1403 is configured to implement Step S130 shown inFIG. 1, the stitching module 1404 is configured to implement Step S140shown in FIG. 1, the processing module 1405 is configured to implementStep S150 shown in FIG. 1, the second binarization module 1406 isconfigured to implement Step S160 shown in FIG. 1, and the synthesismodule 1407 is configured to implement Step S170 shown in FIG. 1.Therefore, for the specific description of the obtaining module 1401,reference may be made to the related description of

Step S110 shown in FIG. 1 in the embodiment of the image processingmethod; for the specific description of the slicing module 1402,reference may be made to the related description of Step S120 shown inFIG. 1 in the embodiment of the image processing method; for thespecific description of the first binarization module 1403, referencemay be made to the related description of Step S130 shown in FIG. 1 inthe embodiment of the image processing method; for the specificdescription of the stitching module 1404, reference may be made to therelated description of Step S140 shown in FIG. 1 in the embodiment ofthe image processing method; for the specific description of theprocessing module 1405, reference may be made to the related descriptionof Step S150 shown in FIG. 1 in the embodiment of the image processingmethod; for the specific description of the second binarization module1406, reference may be made to the related description of Step S160shown in FIG. 1 in the embodiment of the image processing method; andfor the specific description of the synthesis module 1407, reference maybe made to the related description of Step S170 shown in FIG. 1 in theembodiment of the image processing method. In addition, the imageprocessing device may implement technical effects similar to the imageprocessing method, which will not be repeated here.

At least one embodiment of the disclosure further provides an electronicapparatus. FIG. 15 is a schematic block diagram of an electronicapparatus according to at least one embodiment of the disclosure.

For example, as shown in FIG. 15, the electronic apparatus includes aprocessor 1001, a communication interface 1002, a memory 1003, and acommunication bus 1004. The processor 1001, the communication interface1002, and the memory 1003 implement mutual communicate through thecommunication bus 1004. Components such as the processor 1001, thecommunication interface 1002, and the memory 1003 may also communicatethrough a network connection. The disclosure does not limit the type andfunctions of the network.

For example, the memory 1003 is configured to non-transitorily store acomputer-readable instruction. The processor 1001 is configured to runthe computer-readable instruction.

When the computer-readable instruction is run by the processor 1001, theimage processing method according to any embodiment of the disclosure isimplemented. For the specific implementation of each step of the imageprocessing method and related explanation content, reference may be madeto the embodiment of the image processing method, which will not berepeated here.

For example, the processor 1001 executes a program stored in the memory1003 to implement the implementation manner of the image processingmethod, which is the same as the implementation manner mentioned in theembodiment part of the image processing method and will not be repeatedhere.

For example, the communication bus 1004 may be a peripheral componentinterconnect (PCI) bus, an enhanced industry standard architecture(EISA) bus, etc. The communication bus may be divided into an addressbus, a data bus, a control bus, etc. For ease of indication, the same isindicated by only one thick line in the drawing, but it does notindicate that there is only one bus or one type of bus.

For example, the communication interface 1002 is configured to implementcommunication between the electronic apparatus and other apparatuses.

For example, the processor 1001 and memory 1003 can be disposed on theserver side (or the cloud).

For example, the processor 1001 may control other components in theelectronic apparatus to execute desired functions. The processor 1001may be a central processing unit (CPU), a network processor (NP), etc.;and may also be a digital signal processor (DSP), an applicationspecific integrated circuit (ASIC), a field programmable gate array(FPGA), or other programmable logic devices, discrete gate or transistorlogic devices, and discrete hardware components. The CPU may be X86,advanced RISC machine (ARM) architecture, etc.

For example, the memory 1003 may include any combination of one or morecomputer program products. The computer program product may includevarious forms of computer-readable storage mediums, such as volatilememories and/or non-volatile memories. The volatile memory may, forexample, include a random access memory (RAM) and/or a cache. Thenon-volatile memory may, for example, include a read-only memory (ROM),a hard disk, an erasable programmable read-only memory (EPROM), acompact disk read-only memory (CD-ROM), a universal serial bus (USB)memory, a flash memory, etc. One or more computer-readable instructionsmay be stored in the computer-readable storage medium. The processor1001 may run the computer-readable instructions to implement variousfunctions of the electronic apparatus. Various applications and variousdata may also be stored in the storage medium.

For example, for detailed description of the process of performing imageprocessing by the electronic apparatus, reference may be made to therelevant description in the embodiment of the image processing method,which will not be repeated.

FIG. 16 is a schematic diagram of a non-transitory computer-readablestorage medium according to at least one embodiment of the disclosure.For example, as shown in FIG. 16, one or more computer-readableinstructions 1101 may be non-transitorily stored in a storage medium1100. For example, when the computer-readable instruction 1101 isexecuted by the processor, one or more steps in the image processingmethod according to the above may be executed.

For example, the storage medium 1100 may be applied to the electronicapparatus and/or the image processing device 1400. For example, thestorage medium 1100 may include the memory 1003 in the electronicapparatus.

For example, for the description of the storage medium 1100, referencemay be made to the description of the memory in the embodiment of theelectronic apparatus, which will not be repeated.

FIG. 17 is a schematic diagram of a hardware environment according to atleast one embodiment of the disclosure. The electronic apparatusaccording to the disclosure may be applied to an Internet system.

The computer system provided in FIG. 17 may be used to implement thefunctions of the image processing device and/or the electronic apparatusin the disclosure. Such computer systems may include personal computers,laptops, tablet computers, mobile phones, personal digital assistants,smart glasses, smart watches, smart rings, smart helmets, and any smartportable apparatuses or wearable apparatuses. The specific system in theembodiment uses a functional block diagram to explain a hardwareplatform containing a user interface. Such computer apparatus may be ageneral-purpose computer apparatus or a special-purpose computerapparatus. Both computer apparatuses may be used to implement the imageprocessing device and/or the electronic apparatus in the embodiment. Thecomputer system may include any component implementing currentlydescribed information required to implement image processing. Forexample, the computer system can be implemented by the computerapparatus through a hardware apparatus, a software program, firmware,and a combination thereof of the computer apparatus. For convenience,only one computer apparatus is shown in FIG. 17, but the computerfunctions related to the information required for image processingaccording to the embodiment may be implemented by a set of similarplatforms in a distributed manner to disperse the processing load of thecomputer system.

As shown in FIG. 17, the computer system may include a communicationport 250 connected to a network implementing data communication. Forexample, the computer system may send and receive information and datathrough the communication port 250, that is, the communication port 250may implement wireless or wired communication between the computersystem and other electronic apparatuses to exchange data. The computersystem may also include a processor set 220 (that is, the processordescribed above) for executing program instructions. The processor set220 may be composed of at least one processor (for example, a CPU). Thecomputer system may include an internal communication bus 210. Thecomputer system may include different forms of program storage units anddata storage units (that is, the memory or the storage medium describedabove), such as a hard disk 270, a read-only memory (ROM) 230, and arandom access memory (RAM) 240, which can be configured to store variousdata files used for computer processing and/or communication andpossible program instructions executed by the processor set 220. Thecomputer system may further include an input/output component 260. Theinput/output component 260 is configured to implement input/output dataflow between the computer system and other components (for example, auser interface 280, etc.).

Generally, the following devices may be connected to the input/outputcomponent 260: an input device such as a touch screen, a touch pad, akeyboard, a mouse, a camera, a microphone, an accelerometer, and agyroscope; an output device such as a liquid crystal display (LCD), aspeaker, and a vibrator; a storage device such as a tape and a harddisk; and a communication interface.

Although FIG. 17 shows a computer system with various devices, it shouldbe understood that the computer system is not required to have all thedevices shown. Alternatively, the computer system may have more or fewerdevices.

For the disclosure, the following points need to be explained:

(1) The drawings of the embodiments of the disclosure only refer to thestructures related to the embodiments of the disclosure. For otherstructures, reference may be made to conventional designs.

(2) For clarity, in the drawings for describing the embodiments of thedisclosure, the thickness and the size of layers or structures areexaggerated. It will be understood that when an element such as a layer,a film, a region, or a substrate is referred to as being “on” or “under”another element, the element may be “directly” on or “under” anotherelement or there may be an intermediate element therebetween.

(3) In the case of no conflict, the embodiments of the disclosure andthe features in the embodiments may be combined with one other to obtainnew embodiments.

The above are only specific implementation manners of the disclosure,but the protection scope of the disclosure is not limited thereto. Theprotection scope of the disclosure shall be defined by the protectionscope of the claims.

What is claimed is:
 1. An image processing method, comprising: obtainingan original image, wherein the original image comprises at least oneobject; performing a slicing processing on the original image to obtaina plurality of slice images of the original image; respectivelyprocessing the slice images through a first binarization model to obtaina plurality of slice binary images respectively corresponding to theslice images; performing a stitching processing on the slice binaryimages to obtain a first binary image; processing the first binary imageto obtain a pixel circumscribed contour image, wherein the pixelcircumscribed contour image comprises a plurality of circumscribedcontour pixels, and pixels in a region surrounded by the circumscribedcontour pixels are pixels corresponding to at least a part of the atleast one object; processing the original image through a secondbinarization model to obtain a second binary image; and synthesizing thesecond binary image and the first binary image according to positions ofthe circumscribed contour pixels in the pixel circumscribed contourimage to obtain a synthetic image, wherein the synthetic image is abinary image.
 2. The image processing method according to claim 1,wherein performing the slicing processing on the original image toobtain the slice images of the original image comprises: determining afirst slice size and an extension slice size; determining a second slicesize according to the first slice size and the extension slice size;determining a number of slices according to a size of the original imageand the second slice size; and performing the slicing processing on theoriginal image according to the extension slice size, the second slicesize, and the number of slices to obtain the slice images of theoriginal image, wherein a number of slice images is equal to the numberof slices, and a size of each slice image in the slice images is thefirst slice size.
 3. The image processing method according to claim 2,wherein performing the slicing processing on the original imageaccording to the extension slice size, the second slice size, and thenumber of slices to obtain the slice images of the original imagecomprises: determining an original image to be sliced based on theoriginal image according to the second slice size and the number ofslices; and performing the slicing processing on the original image tobe sliced based on the second slice size and the extension slice size toobtain the slice images.
 4. The image processing method according toclaim 3, wherein performing the slicing processing on the original imageto be sliced based on the second slice size and the extension slice sizeto obtain the slice images comprises: dividing the original image to besliced into a plurality of subregions according to the second slicesize, wherein a number of subregions is equal to the number of slices;and performing the slicing processing on the original image to be slicedaccording to the extension slice size and the subregions to obtain theslice images, wherein the slice images correspond to the subregionsone-to-one, and each slice image in the slice images comprises acorresponding subregion in the subregions.
 5. The image processingmethod according to claim 4, wherein the original image comprises fourfixed edges, each subregion in the subregions comprises four regionedges, and performing the slicing processing on the original image to besliced according to the extension slice size and the subregions toobtain the slice images comprises: in response to all four region edgescorresponding to an i-th subregion in the subregions not overlappingwith the four fixed edges, respectively extending the four region edgescorresponding to the i-th subregion by the extension slice size in adirection away from the i-th subregion with the i-th subregion as acenter to obtain a slice position corresponding to a slice imagecorresponding to the i-th subregion, and slicing the original image tobe sliced according to the slice position to obtain the slice imagecorresponding to the i-th subregion; in response to one region edge inthe four region edges corresponding to the i-th subregion in thesubregions overlapping with one fixed edge in the four fixed edges,extending a region edge opposite to the one region edge in the fourregion edges by twice the extension slice size in the direction awayfrom the i-th subregion, and respectively extending region edgesadjacent to the one region edge in the four region edges by theextension slice size in the direction away from the i-th subregion toobtain the slice position corresponding to the slice image correspondingto the i-th subregion, and slicing the original image to be slicedaccording to the slice position to obtain the slice image correspondingto the i-th subregion; or in response to two region edges in the fourregion edges corresponding to the i-th subregion in the subregionsoverlapping with two fixed edges in the four fixed edges, extendingother region edges other than the two region edges in the four regionedges by twice the extension slice size in the direction away from thei-th subregion to obtain the slice position corresponding to the sliceimage corresponding to the i-th subregion, and slicing the originalimage to be sliced according to the slice position to obtain the sliceimage corresponding to the i-th subregion, where i is a positive integerand is less than or equal to the number of subregions.
 6. The imageprocessing method according to claim 4, wherein a size of each slicebinary image in the slice binary images is the first slice size, andperforming the stitching processing on the slice binary images to obtainthe first binary image comprises: determining a positional relationshipof the slice binary images according to a positional relationship of thesubregions in the original image to be sliced; performing the stitchingprocessing on the slice binary images based on the positionalrelationship of the slice binary images to obtain a binary predictionimage; and in response to a size of the binary prediction image beingnot equal to the size of the original image, performing a sizerestoration processing on the binary prediction image to obtain thefirst binary image, and in response to the size of the binary predictionimage being equal to the size of the original image, using the binaryprediction image as the first binary image, wherein a size of the firstbinary image is the same as the size of the original image.
 7. The imageprocessing method according to claim 6, wherein all pixels in the firstbinary image are arranged in n rows and m columns, and performing thestitching processing on the slice binary images based on the positionalrelationship of the slice binary images to obtain the binary predictionimage comprises: performing the stitching processing on the slice binaryimages based on the positional relationship of the slice binary imagesto obtain an intermediate binary prediction image, wherein all pixels inthe intermediate binary prediction images are arranged in n rows and mcolumns; in response to a t1-th row and a t2-th column in theintermediate binary prediction image including only one pixel, using agrayscale value of the one pixel located in the t1-th row and the t2-thcolumn as a grayscale value of a pixel in a t1-th row and a t2-th columnin the binary prediction image; and in response to the t1-th row and thet2-th column in the intermediate binary prediction image including aplurality of pixels, performing an OR operation on grayscale values ofthe pixels located in the t1-th row and the t2-th column to obtaingrayscale values of pixels in the t1-th row and the t2-th column in thebinary prediction image, where n, m, t1, and t2 are all positiveintegers, t1 is less than or equal to n, and t2 is less than or equal tom.
 8. The image processing method according to claim 1, whereinperforming the slicing processing on the original image to obtain theslice images of the original image comprises: determining a second slicesize; determining a number of slices according to a size of the originalimage and the second slice size; and performing the slicing processingon the original image according to the second slice size and the numberof slices to obtain the slice images of the original image, wherein anumber of slice images is equal to the number of slices, and a size ofeach slice image in the slice images is the second slice size.
 9. Theimage processing method according to claim 8, wherein performing theslicing processing on the original image according to the second slicesize and the number of slices to obtain the slice images of the originalimage comprises: determining an original image to be sliced based on theoriginal image according to the second slice size and the number ofslices; and performing the slicing processing on the original image tobe sliced based on the second slice size to obtain the slice images. 10.The image processing method according to claim 9, wherein a size of eachslice binary image in the slice binary images is the second slice size,and performing the stitching processing on the slice binary images toobtain the first binary image comprises: determining a positionalrelationship of the slice binary images according to a positionalrelationship of the slice images in the original image to be sliced;performing the stitching processing on the slice binary images based onthe positional relationship of the slice binary images to obtain abinary prediction image; and in response to a size of the binaryprediction image being not equal to the size of the original image,performing a size restoration processing on the binary prediction imageto obtain the first binary image, and in response to the size of thebinary prediction image being equal to the size of the original image,using the binary prediction image as the first binary image, wherein asize of the first binary image is the same as the size of the originalimage.
 11. The image processing method according to claim 3, whereindetermining the original image to be sliced based on the original imageaccording to the second slice size and the number of slices comprises:determining a size to be sliced according to the second slice size andthe number of slices; in response to the size of the original imagebeing the same as the size to be sliced, using the original image as theoriginal image to be sliced; and in response to the size of the originalimage being different from the size to be sliced, adjusting the size ofthe original image to obtain the original image to be sliced, wherein asize of the original image to be sliced is the same as the size to besliced.
 12. The image processing method according to claim 2, whereinthe number of slices L is obtained through a following equation:L=round(m/p)×round(n/q) where the size of the original image is m×n, thesecond slice size is p×q, and round(*) indicates a rounding function.13. The image processing method according to claim 1, wherein processingthe first binary image to obtain the pixel circumscribed contour imagecomprises: performing a blurring processing on the first binary image toobtain a blur image; and performing a XOR processing on the blur imageand the first binary image to obtain the pixel circumscribed contourimage.
 14. The image processing method according to claim 13, whereinsynthesizing the second binary image and the first binary imageaccording to the positions of the circumscribed contour pixels in thepixel circumscribed contour image to obtain the synthetic imagecomprises: obtaining the positions of the circumscribed contour pixelsin the pixel circumscribed contour image; extracting a plurality oftarget second binary pixels at positions in the second binary imagecorresponding to the positions of the circumscribed contour pixels; andrespectively synthesizing the target second binary pixels in the secondbinary image to same positions in the first binary image according to apixel correspondence between the second binary image and the firstbinary image to obtain the synthetic image.
 15. The image processingmethod according to claim 1, wherein processing the original imagethrough the second binarization model to obtain the second binary imagecomprises: performing a grayscale processing on the original image toobtain a grayscale image; processing the grayscale image according to afirst threshold to obtain an intermediate binary image; performing aguiding filtering processing on the grayscale image by using theintermediate binary image as a guiding image to obtain a filter image;determining a high-value pixel in the filter image according to a secondthreshold, wherein a grayscale value of the high-value pixel is greaterthan the second threshold; performing an expanding processing on thegrayscale value of the high-value pixel according to a preset expansioncoefficient to obtain an expansion image; performing a sharpeningprocessing on the expansion image to obtain a clear image; and adjustinga contrast of the clear image to obtain the second binary image.
 16. Theimage processing method according to claim 1, further comprising:performing a black edge removal processing on the synthetic image. 17.The image processing method according to claim 16, wherein performingthe black edge removal processing on the synthetic image comprises:determining an edge region of the synthetic image; traversing the edgeregion of the synthetic image to judge whether there is a black regionwhose size exceeds a preset threshold; and in response to the edgeregion including at least one black region whose size exceeds the presetthreshold, setting a grayscale value of a pixel corresponding to the atleast one black region to a preset grayscale value.
 18. An imageprocessing device, comprising: an obtaining module, configured to obtainan original image, wherein the original image comprises at least oneobject; a slicing module, configured to perform a slicing processing onthe original image to obtain a plurality of slice images of the originalimage; a first binarization module, configured to respectively processthe slice images through a first binarization model to obtain aplurality of slice binary images respectively corresponding to the sliceimages; a stitching module, configured to perform a stitching processingon the slice binary images to obtain a first binary image; a processingmodule, configured to process the first binary image to obtain a pixelcircumscribed contour image, wherein the pixel circumscribed contourimage comprises a plurality of circumscribed contour pixels, and pixelsin a region surrounded by the circumscribed contour pixels are pixelscorresponding to at least a part of the at least one object; a secondbinarization module, configured to process the original image through asecond binarization model to obtain a second binary image; and asynthesis module, configured to synthesize the second binary image andthe first binary image according to positions of the circumscribedcontour pixels in the pixel circumscribed contour image to obtain asynthetic image, wherein the synthetic image is a binary image.
 19. Anelectronic apparatus, comprising: a memory, configured tonon-transitorily store a computer-readable instruction; and a processor,configured to run the computer-readable instruction, and when thecomputer-readable instruction is run by the processor, the imageprocessing method according to claim 1 is implemented.
 20. Anon-transitory computer-readable storage medium, storing acomputer-readable instruction, wherein when the computer-readableinstruction is executed by a processor, the image processing methodaccording to claim 1 is implemented.